Handle invalid gif animations a little bit more robustly. (#357974,
authorMatthias Clasen <matthiasc@src.gnome.org>
Thu, 21 Dec 2006 23:27:01 +0000 (23:27 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 21 Dec 2006 23:27:01 +0000 (23:27 +0000)
        * io-gif.c (gif_get_lzw): Handle invalid gif animations
        a little bit more robustly.  (#357974, Vassilis Pandis,
        patch by Felix Riemann)

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-gif.c

index fc9901034056bf5c476b4abd68b346e8a38bd453..7bc8e58265d9c94496d972c0da5f87065ff5fa8e 100644 (file)
@@ -1,5 +1,9 @@
 2006-12-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * io-gif.c (gif_get_lzw): Handle invalid gif animations
+       a little bit more robustly.  (#357974, Vassilis Pandis,
+       patch by Felix Riemann)
+
        * gdk-pixbuf-data.c (gdk_pixbuf_new_from_data):
        * gdk-pixbuf.c (gdk_pixbuf_new): Remove redundant size
        checks, and document that width, height must be > 0.
index 004aa484e54cf3fbeb51025f77257717169f65ac..5459424b14d468894083e97427b8f6a528769d5e 100644 (file)
@@ -908,6 +908,11 @@ gif_get_lzw (GifContext *context)
 
                 /* Only call prepare_func for the first frame */
                if (context->animation->frames->next == NULL) { 
+                        if (context->animation->width == 0 )
+                                context->animation->width = gdk_pixbuf_get_width(context->frame->pixbuf);
+                        if (context->animation->height == 0)
+                                context->animation->height = gdk_pixbuf_get_height (context->frame->pixbuf);
+
                         if (context->prepare_func)
                                 (* context->prepare_func) (context->frame->pixbuf,
                                                            GDK_PIXBUF_ANIMATION (context->animation),